import {get,post} from "@/api/http";
import axios from "axios";

//===========================================================人工客服

//发起请求客服咨询
export const newsletterInitiate = (params) => {
    return post('/newsletter/initiate', params)
}

//===========================================================基本配置

//课程信息
export const courseInfo = (params) => {
    return get('/basic/course/info',params)
}

//综合搜索
export const complexSearch = (params) => {
    return get('/basic/complex/search',params)
}

//公共类型
export const types = (params) => {
    return get('/basic/types',params)
}

//资迅
export const basicInformation = (params) => {
    return get('/basic/information',params)
}

//查看资讯详情信息
export const basicInformationMessage = (params) => {
    return get(`/basic/information/${params.id}`)
}

//课程公告
export const basicBulletin = (params) => {
    return get(`/basic/bulletin/${params.courseID}`)
}

//获取获取腾讯Im登录token
export const meImToken = () => {
    return get(`/me/imToken`)
}

//===========================================================个人

//token验证换取
export const meVerifyToken = (params) => {
    return post('/me/verifyToken',params)
}

//【问答】常见问题列表
export const basicProblemList = (params) => {
    return get('/basic/problemList',params)
}

//建议反馈
export const basicFeedback = (params) => {
    return post('/basic/feedback', params)
}

//常见问题列表
export const basicAppProblem = (params) => {
    return get('/basic/appProblem',params)
}

//常见问题详情
export const basicAppProblemMessage = (id) => {
    return get(`/basic/appProblem/${id}`)
}

//练习手册列表
export const basicManualList = (params) => {
    return get('/basic/manualList',params)
}

//发送验证码
export const sms_captcha = (params) => {
    return post('/me/sms_captcha', params)
}

//验证码修改密码
export const meRevisePassword = (params) => {
    return post('/me/revise/password', params)
}

//获取个人信息
export const userInfo = () => {
    return get('/me')
}

//更新个人信息
export const meRenewInfo = (params) => {
    return post('/me/renewInfo', params)
}

//登录
export const login = (data) => {
    return post('/me/login', data)
}

//收藏或取消收藏
export const meCollectORCancel = (params) => {
    return post('/me/collectORCancel', params)
}

//===========================================================题库

//税率表
export const taxRateTable = () =>{
    return get(`/basic/tax_rate_table`)
}

//Banner图
export const bannerList = (params) =>{
    return get(`/basic/banner/${params.id}?type=${params.type}`)
}

//=========================================每日一练

//提交每日一练
export const exerciseSubmit = params =>{
    return post(`/exercise/submit`,params)
}

//练习列表
export const exercise = params =>{
    return get(`/exercise/`,params)
}

//习题库详情
export const exerciseMessage = params =>{
    return get(`/exercise/${params.id}`)//?isRecordClear=${params.isRecordClear}
}

//生成练习题
export const createdExercise = params =>{
    return post(`/exercise/exercise`,params)
}

//生成练习题(自定义)
export const ExerciseModel = params =>{
    return post(`/exercise/model`,params)
}

//查询科目模式
export const ExerciseModelSubject = params =>{
    return get(`/exercise/model/${params.subjectID}`)
}

//获取题型列表展示
export const typeCodeList = params =>{
    return get(`/exercise/typeCode/list`,params)
}

//题目数量的筛选
export const exerciseTopicFilter = params =>{
    return post(`/exercise/topic/filter`,params)
}

//=========================================章节训练
//提交
export const chapterFinishUpOb = params =>{
    return post(`/chapter/finishUpOb`,params)
}

//章节列表
export const createdChapter = params =>{
    return get(`/chapter`,params)
}

//生成节做题或找回记录
export const chapterPointTopic = params =>{
    return post(`/chapter/pointTopic`,params)
}

//章节做题或找回记录
export const allTopic = params =>{
    return post(`/chapter/allTopic`,params)
}

//章节练习记录详情
export const chapterLog = params =>{
    return get(`/chapter/log/${params.id}`)
}

//=========================================整卷练习

//生成试卷
export const examPaperGenerate = params =>{
    return post(`/examPaper/generate`,params)
}

//做题历史
export const examPaper = params =>{
    return get(`examPaper`,params)
}

//查看记录
export const lookExamPaper = params =>{
    return get(`/examPaper/${params.subjectID}`)
}

//试卷解析
export const examPaperParse = params =>{
    return post(`/examPaper/parse`,params)
}




//=========================================模拟考试 真题演练（试卷）

//试卷列表 根据type判断是 真题演练列表 还是 模拟考试列表
export const createdTestPaper = params =>{
    return get(`/testPaper`,params)
}

//生成真题演练试卷
export const createdTestPaperReal = params =>{
    return post(`/testPaper/generate/real`,params)
}

//生成模拟考试试卷
export const createdTestPaperMockTest = params =>{
    return post(`/testPaper/generate/mockTest`,params)
}

//做题历史列表
export const testPaperLogList = params =>{
    return get(`/testPaper/logList`,params)
}

//做题历史详情
export const testPaperDetailLog = params =>{
    return get(`/testPaper/detailLog/${params.testPaperID}`)
}

//提交或保存试卷
export const testPaperAnalyze = params =>{
    return post(`/testPaper/analyze`,params)
}



//=========================================收藏模块(错题集)

//查看单个题目详情
export const collectTopic = params =>{
    return get(`/collect/topic/${params.id}`)
}

//获取多个题目组成习题
export const collectTopics = params =>{
    return post(`/collect/topics`,params)
}

//收藏列表
export const collect = params =>{
    return get(`/collect`,params)
}

//取消收藏
export const collectRemove = params =>{
    return post(`/collect/batch/remove`,params)
}

//错题集列表
export const errorSet = params =>{
    return get(`/collect/errorSet`,params)
}

//获取多个题目组成习题
export const getCollectTopics = params =>{
    return post(`/collect/topics`,params)
}

//课程列表
export const courseList = () =>{
    return get('/basic/course')
}

//科目列表
export const subjectList = (params) =>{
    return get('/basic/subject',params)
}

//===========================================================网课

//记录观看视频时长
export const videoTimer = (params) =>{
    return post('/video/video/timer',params)
}

//获取播放权限
export const videoAuth = (params) =>{
    return post('/video/video/auth',params)
}

//免费试听课程分类列表
export const videoFreeCourse = () =>{
    return get('/video/freeCourse')
}

//免费试听试题列表
export const videoFreeVideoList = (params) =>{
    return get('/video/freeVideoList',params)
}

//我的课程科目列表
export const videoMyCoursesList = (params) =>{
    return get('/video/myCoursesList',params)
}

//跳转章节定位到最近观看视频【付费课程,章节列表】
export const videoChapter = (params) =>{
    return get('/video/chapter',params)
}
//播放授权与视频信息
export const videoAuthVideo = (params) =>{
    return get(`/video/authVideo/${params.id}`)
}

//最近学习视频列表
export const recentVideoList = (params) =>{
    return get(`/recent/videoList`,params)
}

//最近在学
export const recentLatelyLearn = (params) =>{
    return get(`/recent/latelyLearn`,params)
}

//在学题目列表
export const recentTopicList = (params) =>{
    return get(`/recent/topicList`,params)
}

//===========================================================直播模块

//直播列表
export const liveReserve = (params) =>{
    return get(`/liveReserve`,params)
}

//详情直播
export const liveReserveMessage = (params) =>{
    return get(`/liveReserve/${params.id}?courseID=${params.course}`)
}

//预约或取消
export const liveReserveReserve = (params) =>{
    return post(`/liveReserve/reserve`,params)
}

//更新观看直播时长
export const liveReserveLogTime = (params) =>{
    return post(`/liveReserve/log/time`,params)
}

//===========================================================通讯
//会话列表
export const newsletter = (params) =>{
    return get(`/newsletter`,params)
}

//会话聊天记录列表
export const newsletterToChatWith = () =>{
    return get(`/newsletter/toChatWith`)
}

























